This is the way passwords are stored on modern Windows systems, and can be obtained by dumping the SAM database, or using Mimikatz. They are also stored on domain controllers in the NTDS file. These are the hashes you can use to pass-the-hash.
case-sensitive
supports almost the entire Unicode character set of 65,536 characters
NT hash calculates the hash based on the entire password the user entered
Can be relayed to other servers if SMB Signing is disabled
Can also be relayed back to the same server if does not have patch (MS08-068)
Can relay cross-protocol if has patch
The NTLM protocol uses the NTHash in a challenge/response between a server and a client. The v1 of the protocol uses both the NT and LM hash, depending on configuration and what is available.
How the password is hashed:
#C = 8-byte server challenge, random
C=os.urandom(8)#Generate a NT hash
nt_hash=generate_NT_Hash(password)#Generate a LM hash with up to 14 char password
lm_hash=generate_LM_Hash(password)#Pad the key
#Similar to the LM hash use the hash as the key for encrypting the server challenge
lm_response=DES_block(lm_hash[:7],C)+DES_block(lm_hash[:7:14],C)+DES_block(lm_hash[14:],C)nt_response=DES_block(nt_hash[:7],C)+DES_block(nt_hash[:7:14],C)+DES_block(nt_hash[14:],C)#K1 | K2 | K3 = LM/NT-hash | 5-bytes-0
combined_key=nt_hash+"\x00\x00\x00\x00\x00\x00"key1, key2, key3=combined_keyresponse=DES(K1,C)|DES(K2,C)|DES(K3,C)
This is the new and improved version of the NTLM protocol, which makes it a bit harder to crack. The concept is the same as NTLMv1, only different algorithm and responses sent to the server. Also captured through [Responder](/Red Team/Responder.md) or similar. Default in Windows since Windows 2000.
Relaying hashes back to the same machine wont work with the MS08-068 update. It is possible to do so in a cross-protocol relay attack.
It is possible to relay the hash to another machine.
This is only possible with SMB signing turned off which is default except for Windows Server OS’s.